# !/usr/bin/evn python3
# -*- coding: utf-8 -*-
# File Name: route.py
# Created Date: 2017-11-24 10:09:03
from flask import request, jsonify, g
from . import main
#from .views import users, orders
#from app.models.user import User
#from .views.list_view import ListAPI
#from .views import  uploads
from .base import *
#main.add_url_rule("/", view_func=users.users)
#main.add_url_rule("/users/<int:id>", view_func=users.user)
#main.add_url_rule("/orders", view_func=orders.orders)
#main.add_url_rule("/orders", view_func=orders.create_order, methods=["POST"])
#main.add_url_rule("/orders/<int:id>", view_func=orders.update_order, methods=["POST"])
#main.add_url_rule("/lists", view_func=ListAPI.as_view("lists", template_name="users"))
#main.add_url_rule("/lists/about", view_func=ListAPI.as_view("about", template_name="orders"))
#main.add_url_rule("/uploads", view_func=ListAPI.as_view('upload', template_name="upload"), methods=["POST"])
main.add_url_rule("/", view_func=index)
#@main.before_request
#def check_login():
#    token = request.headers.get('Authorization', None)
#    user = User.conver_token(token)
#    if token and user:
#        g.current_user = user.to_json()
#    else:
#        return jsonify({'msg': "需要授权", 'code': 401}), 200
#
